package com.osce.basic.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csce.domain.entity.basic.BasicUserExperience;
import com.osce.basic.mapper.BasicUserExperienceMapper;
import com.osce.common.utils.DateUtils;
import com.osce.interfaces.basic.IBasicUserExperienceService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户经历Service业务层处理
 *
 * @author zzx
 * @since 2023-07-18
 */
@Service
public class BasicUserExperienceServiceImpl extends ServiceImpl<BasicUserExperienceMapper, BasicUserExperience> implements IBasicUserExperienceService {


    /**
     * 查询用户经历
     *
     * @param id 用户经历主键
     * @return 用户经历
     */
    @Override
    public BasicUserExperience selectBasicUserExperienceById(Long id) {
        return baseMapper.selectBasicUserExperienceById(id);
    }

    /**
     * 查询用户经历列表
     *
     * @param basicUserExperience 用户经历
     * @return 用户经历
     */
    @Override
    public List<BasicUserExperience> selectBasicUserExperienceList(BasicUserExperience basicUserExperience) {
        return baseMapper.selectBasicUserExperienceList(basicUserExperience);
    }

    /**
     * 新增用户经历
     *
     * @param basicUserExperience 用户经历
     * @return 结果
     */
    @Override
    public int insertBasicUserExperience(BasicUserExperience basicUserExperience) {
        basicUserExperience.setCreateTime(DateUtils.getNowDate());
        return baseMapper.insertBasicUserExperience(basicUserExperience);
    }

    /**
     * 修改用户经历
     *
     * @param basicUserExperience 用户经历
     * @return 结果
     */
    @Override
    public int updateBasicUserExperience(BasicUserExperience basicUserExperience) {
        return baseMapper.updateBasicUserExperience(basicUserExperience);
    }

    /**
     * 批量删除用户经历
     *
     * @param ids 需要删除的用户经历主键
     * @return 结果
     */
    @Override
    public int deleteBasicUserExperienceByIds(Long[] ids) {
        return baseMapper.deleteBasicUserExperienceByIds(ids);
    }

    /**
     * 删除用户经历信息
     *
     * @param id 用户经历主键
     * @return 结果
     */
    @Override
    public int deleteBasicUserExperienceById(Long id) {
        return baseMapper.deleteBasicUserExperienceById(id);
    }
}
